<!DOCTYPE html>
<html>
	<head>
		  <meta charset="utf-8">
		  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		  <title></title>
		  <link href="../../static/mui/css/mui.min.css" rel="stylesheet"/>
		  <style type="text/css">
			  .mui-btn-block {
			   	    padding: 9px 0;
				}
		  </style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav" style="background-color:#dd524d ;">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color:#fff"></a>
		    <h1 class="mui-title" style="color:#fff;" >修改密码</h1>
		</header>
		<div class="mui-content" style="margin-top:20px;" >
		    <form class="mui-input-group">
		        <div class="mui-input-row">
		            <input type="text" class="mui-input-clear" id="phoneContext" placeholder="输入手机号" disabled="disabled">
		        </div>
		    </form>
		    <div class="mui-content-padded">
				<button id="doUpdateBtn" type="button" class="mui-btn mui-btn-block mui-btn-primary">获得验证码</button>
			</div>
		</div>
		<script src="../../static/mui/js/mui.min.js" type="text/javascript"></script>
	    <script src="../../static/lib/jquery-1.11.2.min.js" type="text/javascript"></script>
	    <script src="../../static/app/js/kit.js" type="text/javascript"></script>
	    <script src="../../static/app/js/api.js" type="text/javascript"></script>
	    <script type="text/javascript">
	    mui.plusReady(function(){
	    	var phone=Kit.dao.get("SHOP",true).TEL;
	    	$("#phoneContext").val(phone)
    		document.getElementById("doUpdateBtn").addEventListener("tap",function(data){
    			var showMask = Kit.ui.showLoading("",{back:"none"});
    			var phone = $("#phoneContext").val();
    			if(!phone){
    				Kit.ui.alert("手机号不能为空");
    				showMask.close();
    				return;
    			}else{
    				API.sendResetPwdCode(phone,function(){
    					showMask.close();
    					mui.openWindow({
						    url:"doUpdatePwd.html",
						    extras:{
						        phone:phone
						    }
						});
    				},function(){
    					showMask.close();
    				});
    			}
	    	});
	    })
	    </script>
	</body>
</html>
